<div class="search-box">
	<form class="search_form layui-form" lay-filter="category_search_form">
		{if condition="$get_site['site_name'] EQ '主站'"}
		<div class="layui-inline">
			<label class="layui-form-label">分站</label>
			<div class="layui-input-inline">
				<select name="site_id" lay-filter="site_id" lay-search="">
					<option value="">主站</option>
					{volist name="site_list" id="list"}
					<option value="{$list.site_id}" {if condition="$list.site_id EQ SITE_ID"}selected{/if}>{$list.site_name}</option>
					{/volist}
				</select>
			</div>
		</div>
		{/if}
		<div class="layui-inline">
			<label class="layui-form-label">分类名称</label>
			<div class="layui-input-inline">
				<input type="text" name="category_name" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">英文缩写</label>
			<div class="layui-input-inline">
				<input type="text" name="initails" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="pack-up"></div>
	</form>
</div>
<table class="layui-hide" id="category_list" lay-filter="category_list"></table>
<script>
	var category_list_url = "{:url('category/ajaxCategory')}";
	var category_delete_url = "{:url('category/ajaxDelete')}";
	var category_one_url = "{:url('category/ajaxOneData')}";
	var category_save_url = "{:url('category/saveData')}";
	var category_copy_url = "{:url('category/copy')}";
	var category_cols = {$cols};
	var category_cols_son = {$cols_son};
	var category_cols_end = {$cols_end};
	var category_select_site_id = '';
	var site_data_url = "{:url('category/siteData')}";
	var site_id = "{$site_id}";
	var site_name = '{$get_site.site_name}';
	if($('form[lay-filter="category_search_form"]').find('select[name="site_id"]').length == 1){
		category_select_site_id = $('form[lay-filter="category_search_form"]').find('select[name="site_id"]').val();
	}
</script>
<script src="/static/js/category/category.js" type="text/javascript" charset="utf-8"></script>
<script type="text/html" id="category_tool">
	<div class="layui-btn-group">
		<a class="layui-btn layui-btn-normal layui-btn-xs tap-nav" lay-event="add" data-id="add_category_{{ d.category_sign}}" data-url="{:url('category/tplForm')}?parent_sign={{ d.category_sign}}" data-title="新增子分类"><i class="layui-icon layui-icon-add-1"></i></a>
		<a class="layui-btn layui-btn-xs" lay-event="edit" data-title="修改分类" data-id="edit_category_{{ d.category_sign}}" data-url="{:url('category/tplForm')}?category_sign={{ d.category_sign}}&parent_sign={{ d.category_sign}}"><i class="layui-icon layui-icon-edit"></i></a>
		<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" data-title="删除"><i class="layui-icon layui-icon-delete"></i></a>
		<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="site_data" data-title="分站接口"><i class="layui-icon layui-icon-snowflake"></i></a>
		<a class="layui-btn layui-btn-danger layui-btn-xs hide-update" lay-event="update"><i class="layui-icon layui-icon-up"></i></a>
	</div>
</script>
<script type="text/html" id="category_tool_end">
	<div class="layui-btn-group">
		<a class="layui-btn layui-btn-xs" lay-event="edit" data-title="修改分类" data-id="edit_category_{{ d.category_sign}}" data-url="{:url('category/tplForm')}?category_sign={{ d.category_sign}}&parent_sign={{ d.category_sign}}"><i class="layui-icon layui-icon-edit"></i></a>
		<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" data-title="删除"><i class="layui-icon layui-icon-delete"></i></a>
		<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="site_data" data-title="分站接口"><i class="layui-icon layui-icon-snowflake"></i></a>
		<a class="layui-btn layui-btn-danger layui-btn-xs hide-update" lay-event="update"><i class="layui-icon layui-icon-up"></i></a>
	</div>
</script>
<script type="text/html" id="audit_stateTpl">
	{{# if(d.audit_state == 1){}}
		<div class="layui-anim circle layui-bg-blue" data-title="通过">
			<i class="layui-icon layui-icon-radio"></i>
		</div>
	{{# } else if(d.audit_state == 0){ }}
		<div class="layui-anim circle layui-bg-orange" data-title="等待">
			<i class="layui-icon layui-icon-radio"></i>
		</div>
	{{# } else {}}
		<div class="layui-anim circle layui-bg-red" data-title="驳回">
			<i class="layui-icon layui-icon-radio"></i>
		</div>
	{{# }}}
</script>
<script type="text/html" id="category_toolbar">
  <div class="layui-btn-container">
    <a class="layui-btn layui-btn-sm layui-btn-normal tap-nav" data-id="add_category" data-url="{:url('category/tplForm')}" data-title="新增分类" lay-event="addCategory"><i class="layui-icon layui-icon-add-1"></i>新增分类</a>
    {if condition="$get_site['site_name'] NEQ '主站' AND $get_site['master_site_goods'] EQ 1"}
    <a class="layui-btn layui-btn-sm layui-btn-warm" data-title="采集分类数据" lay-event="copyCategory"><i class="layui-icon layui-icon-template-1"></i>采集分类数据</a>
    {/if}
    {if condition="$get_site['site_name'] EQ '主站'"}
    <a class="layui-btn layui-btn-sm layui-btn-warm" data-title="推送分类数据" lay-event="copyCategory"><i class="layui-icon layui-icon-template-1"></i>推送分类数据</a>
    {/if}
  </div>
</script>